//
//  SingleCase.m
//  OC
//
//  Created by admin on 2019/8/9.
//  Copyright © 2019 猫爷爷的酱醋茶. All rights reserved.
//

#import "SingleCase.h"

@implementation Person

+ (instancetype)allocWithZone:(struct _NSZone *)zone
{
    //instance的值只被赋值一次
    static id instance = nil;
    
    //保证线程安全
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        if(instance == nil)
        {
            instance = [super allocWithZone:zone];
        }
    });
    
    return  instance;
}

+(instancetype)sharedPerson
{
    return  [self new];
}
+(instancetype)defualtPerson
{
    return  [self new];
}


@end
